Correct buffer->size at the same time as buffer->capacity when shrinking down a
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 17 Nov 2005 11:59:12 +0000 (12:59 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 17 Nov 2005 11:59:12 +0000 (12:59 +0100)
commit3805ba3b8ac61cf007fd92226b1ebed0a5828aa2
tree38d251a31eb35d37fe1556de78f8ab8403e07eaa
parentb3670cac54c24e587eeefdc38fd1f70ce81c37ee
Correct buffer->size at the same time as buffer->capacity when shrinking down a
buffer that has grown beyond max_capacity.  This fixes a Xenconsoled segfault
that was caused by stomping around above the buffer's allocated region.  It
became possible to set the max_capacity with changeset 7431, and ever
since then we have been exposed to this bug.  It would most easily be triggered
by running a domain without a client attached to the console, so that the
max_capacity was reached more easily.

Closes bug #380.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/console/daemon/io.c